package com.company;

public class Main {

    public static void main(String[] args) {
	// write your code here

        int x = 0,y = 5;

        try {
            div(x,y);
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println("x=" + x+"\ty=" + y);
    }




    public static int div(int x,int y) throws MyException {
        if(x == 0){
            throw new MyException("除数不能为0",1);
        }

        return y/x;
    }
}
